home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
- ** **
- ** Module: Q3ADUtilities.h **
- ** **
- ** **
- ** Purpose: Implements an After Dark Module using QuickDraw 3D. **
- ** **
- ** **
- ** **
- ** Copyright (C) 1997 Apple Computer, Inc. All rights reserved. **
- ** **
- ** Portions Copyright (C) 1995 Berkeley Systems Inc. **
- ** **
- ** **
- *****************************************************************************/
-
- #ifndef Q3ADUtilities_h
- #define Q3ADUtilities_h
-
- #if PRAGMA_ONCE
- #pragma once
- #endif
-
- #include "GraphicsModule_Types.h"
-
- #include <Errors.h>
-
- #include <QD3D.h>
- #include <QD3DRenderer.h>
- #include <QD3DDrawContext.h>
- #include <QD3DShader.h>
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
-
- #if 0
- #pragma mark GLOBALS
- #endif
- /*
- ** GLOBALS for the following functions
- */
- extern unsigned long gCurrentTicks;
-
- #if 0
- #pragma mark PUBLIC STRUCTURES
- #endif
-
- typedef struct iTQ3ADOffscreen TQ3ADOffscreen;
-
- #if 0
- #pragma mark FUNCTION DECLARATIONS
- #endif
-
- TQ3ADOffscreen *Offscreen_New(
- CGrafPtr inDestPort,
- const Rect *inDestRect,
- long inDithered);
-
- TQ3Status Offscreen_Dispose(
- TQ3ADOffscreen *ioOffscreen);
-
- TQ3Status Offscreen_Blit(
- TQ3ADOffscreen *inOffscreen);
-
- TQ3DrawContextObject Offscreen_NewPixmapDrawContext(
- TQ3ADOffscreen *inOffscreen);
-
- TQ3RendererObject Q3ADUtility_NewRenderer(
- void);
-
- TQ3DrawContextObject Q3ADUtility_NewMacDrawContext(
- CGrafPtr port,
- float paneSize);
-
- TQ3ShaderObject Q3ADUtility_NewShader(
- void);
-
-
- float Q3ADUtility_GetNumInRange(
- float number,
- float offset,
- float width);
-
- Rect Q3ADUtility_GetRectOfBestMonitor(
- MonitorsInfoPtr monitorsInfo);
-
- long Q3ADUtility_GetBestMonitor(
- MonitorsInfoPtr monitorsInfo);
-
- OSErr TQ3Status_to_OSErr(
- TQ3Status inStatus);
-
-
-
- #if 0
- #pragma mark MACROS
- #endif
-
- #define mUnused(x) x
-
- #define mBailIfNULL_(x) if ((x) == NULL) {status = kQ3Failure; goto bail; }
-
- #define mBailIfNot_(x) if (!(x)) {status = kQ3Failure; goto bail; }
-
-
- #define mQ3ADUtility_Begin(x) {gCurrentTicks = TickCount(); }
-
- #define mQ3ADUtility_End(x)
-
- #define mQ3ADUtility_GetSinOfTicks(x) (float)sin(mQ3ADUtility_GetPulse(x))
-
- #define mQ3ADUtility_GetPulse(x) (float)(gCurrentTicks % (long)x) \
- * (6.2857142857/(long)x)
-
-
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
-
- #endif /* Q3ADUtilities_h */
-